Add WebviewBuilder::limit_navigations_to_app_bound_domains - #13848
Conversation
ce543a7 to
9e14491
Compare
|
@FabianLars sorry I just got to rebasing, this should be good to merge in. LMK if there's any changes I should make. |
WebviewBuilder::limit_navigations_to_app_bound_domainsWebviewBuilder::limit_navigations_to_app_bound_domains
|
no worries and thanks for the PR :) |
Package Changes Through ce6dafbThere are 14 changes which include tauri with minor, tauri-cli with minor, @tauri-apps/cli with minor, tauri-runtime with minor, tauri-runtime-wry with minor, tauri-utils with minor, tauri-bundler with minor, tauri-build with minor, tauri-macos-sign with minor, tauri-codegen with minor, tauri-macros with minor, tauri-plugin with minor, tauri-driver with minor, @tauri-apps/api with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
15847b7 to
1aa5ad0
Compare
1aa5ad0 to
0f5a63e
Compare
|
@FabianLars are there any further changes you'd like me to make before this gets merged in? |
|
do you think this should be configurable in tauri.conf.json as well? |
0098ad8 to
4cd3920
Compare
Sure! I wired this up. |
|
@Legend-Master just checking in since I saw you added the 2.12 label recently. Should I rebase my changes again? |
|
Yes, I personally prefer a merge so we don't lose the review history from a rebase + force push, but do whatever you prefer |
done! |
|
Apart from the missing |
It seems that limitAppBoundDomains can be set in MacOS as well but based on searching through the WebKit source code, the sole WebKit issue mentioning limitAppBoundDomains and MacOS (https://bugs.webkit.org/show_bug.cgi?id=216628), and the blog post on App-Bound Domains the flag doesn't change any behavior on MacOS; in fact the internal getter for whether it is set is gated behind a If we do want to have it set the flag on MacOS as well then I'd have to go back and edit Wry as well and I think it's unnecessary to have it do anything on MacOS because the flag only seems to be checked on iOS. |
|
Thanks for the detailed digging! We can merge this first and if it ever gets supported on macOS in the future we can always add that then. |
Legend-Master
left a comment
There was a problem hiding this comment.
Nice work, thanks!
Just a new nitpicks and we can get this merged.
|
When re-reading the doc comment while making the above fixes I realized I forgot to implement this:
Because we don't know what domains people use for their custom protocols at build time (e.g. custom://domain1, custom://domain2, etc.), I'll change the comment to be: I'll try to get the automatic |
|
After inspecting the WebKit source code, I found that the ENABLE_APP_BOUND_DOMAINS is only set to true if PLATFORM(IOS_FAMILY): It also seems that simply adding and: that uses: Note that "https" is added just to immediately be stripped for actually constructing the list of domains that are app-bound. Also see the following for where schemes and domains are checked for app-boundedness. Note especially that either the protocol must be app-bound or the domain must be app-bound. So I will just add localhost by default to the WKAppBoundDomains Info.plist field if limitNavigationsToAppBoundDomains is set in the tauri config. |
…ains` array in `Info.plist` when `limitNavigationsToAppBoundDomains` is enabled. Update the `merge_plist` helper to merge arrays in place while skipping duplicate entries.
|
@Legend-Master Sorry I forgot to add the automatic addition of localhost to the Info.plist file if limitNavigationsToAppBoundDomains is set in the tauri.config.json file. Now I believe this PR should be good to go. |
|
@FabianLars @Legend-Master I've reverted the automatic addition of WKAppBoundDomains and updated the documentation accordingly. Hopefully this PR is finally good to go 😅 |
closes #13847.
Draft because this can only be merged once Wry's version gets bumped to 0.52.1 or greater. Blocked by Wry PR #1578.